package com.white.loggerserver.room

import androidx.room.*

/**
 * Created by ytf on 2020/06/08.
 * Description:
 */
@Dao
interface StyleConfigDaoDao {

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun addStyle(cfg : StyleConfig) : Long

    @Update
    fun updateStyle(rd : StyleConfig)

    @Delete
    fun delStyle(rd : StyleConfig)

    @Query("delete from ${MyRoomDb.styleTableName} where id = :id")
    fun delById(id : Long)

    @Query("select * from ${MyRoomDb.styleTableName}")
    fun getAllRecord() : MutableList<StyleConfig>?

    @Query("select * from ${MyRoomDb.styleTableName} where tagName=:type")
    fun getStyleByType(type : String) : StyleConfig?
}